import { defineStore } from "pinia";
import { ref } from "vue";
export const useMemberStore = defineStore(
  "member",
  () => {
    const profile = ref();
    // 保存会员信息
    const setProfile = (val: any) => {
      profile.value = {
        name: "lilei",
        age: "22",
      };
    };
    const clearProfile = () => {
      profile.value = null;
    };
    return { profile, setProfile, clearProfile };
  },
  {
    persist: {
      storage: {
        getItem(key: string) {
          return uni.getStorageSync(key);
        },
        setItem(key: string, value: any) {
          uni.setStorageSync(key, value);
        },
      },
    },
  }
);
